﻿
using DatabaseCore.Modal;
using NW_WEB_Service.App.Interface;
using NW_WEB_Service.com.app.services;
using Service.src.NW.Model;
using System.Collections.Generic;

namespace Service.src.Flow.Server
{
    public class DataManageService : DBService, DataManageInterface
    {

        public List<SystemTable> FindTableNames(int DBIndex)
        {
            return AppData.DatabaseCache[DBIndex].FindDatabaseTableNames();
        }

        public List<TableStructure> FindTableStructures(string TableName)
        {
            return DBInstance.FindTableStructures(TableName);
        }

        public DBResult QueryBySql(string Sql)
        {
            return DBInstance.QueryBySql(Sql);
        }

        public DBResult PageQueryBySql(string Sql, string TableName, int Page, int Size)
        {
            return DBInstance.PageQueryBySql(Sql, TableName, Page, Size);
        }

        public int ExecuteSql(int DBIndex, string TableName)
        {
            return AppData.DatabaseCache[DBIndex].ExecuteSql(TableName);
        }
    }
}
